﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mui="http://firstfloorsoftware.com/ModernUI"
                    xmlns:app="clr-namespace:BYS.XiAnComDept.App">

    <app:TrimConverter x:Key="Trim"></app:TrimConverter>
    <app:YearConverter x:Key="Year"></app:YearConverter>
    <!-- specify the accent color (optional) -->
    <Color x:Key="AccentColor">#60a917</Color>

    <!-- custom theme resources-->
    <Rectangle x:Key="WindowBackgroundContent" x:Shared="false">
        <Rectangle.Fill>
            <LinearGradientBrush EndPoint="0,1" Opacity=".2">
                <GradientStop Offset="0" Color="Transparent" />
                <GradientStop Offset="1" Color="{DynamicResource AccentColor}" />
            </LinearGradientBrush>
        </Rectangle.Fill>
    </Rectangle>
    <Style x:Key="LinkButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock TextDecorations="Underline">
                        <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Blue" />
        <Setter Property="Cursor" Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="ValidationTemplate">
        <DockPanel LastChildFill="true">
            <Border Background="Red" DockPanel.Dock="right" Margin="5,0,0,0" Width="15" Height="15" CornerRadius="10"
                            ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                <TextBlock HorizontalAlignment="Center" Foreground="White" Margin="0,0,0,3" FontWeight="Bold">!</TextBlock>
            </Border>
            <AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
                <Border BorderBrush="red" BorderThickness="1" />
            </AdornedElementPlaceholder>
        </DockPanel>
    </ControlTemplate>
</ResourceDictionary>